package com.zyh.homework.test07;

import java.util.Scanner;

public class Test7 {
    public static void main(String[] args) {
        System.out.println("请输入密码");
        String password = new Scanner(System.in).next();
        int big=0,small=0,number=0;
        for (int i = 0; i < password.length(); i++) {
            char c = password.charAt(i);
            if (c>='A'&&c<='Z'){
                big++;
            }
            else if (c>='a'&&c<='z'){
                small++;
            }
            else if (c>='0'&&c<='9'){
                number++;
            }
        }
        if (password.length()>=9&&big>=2&&small>0&&number>0){
            System.out.println(password+"是否合法：true");
        }
        else {
            System.out.println(password+"是否合法：false");
        }
    }
}
